//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __MDMA_H
#define __MDMA_H

#include <bulverde.h>

#define CHANNEL_SIZE 32
#define PXA_MMC_IODATA_SIZE 1024
#define MMC_BUFFER_ADDRESS	0xa1000000
#define MMC_READ_DESC		0xa1100000
#define MMC_WRITE_DESC		0xa1200000
#define DCMD_FLOWSRC		(1<<29)
#define DCMD_INCTRGADDR	(1<<30)
#define DCMD_WIDTH1		(1<<14)
#define DCMD_BURST32		(3<<16)
#define DCMD_FLOWTRG		(1<<28)
#define DCMD_INCSRCADDR	(1<<31)
#define DCMD_ENDIRQEN		(1<<21)
#define DDADR_STOP			(1)
#define DCSR_RUN			(1<<31)
#define DCSR_STARTINTR		(1<<1)
#define DCSR_ENDINTR		(1<<2)
#define DCSR_BUSERR			(1)
#define DCSR_STOPINTR		(1<<3)
#define DCSR_STOPINQEN		(1<<29)
#define DRCMR_MAPVLD		(1<<7)

struct dma_channel{
	unsigned int inuse;
	char * name;
	void *irq_handler;
} dma_channels[CHANNEL_SIZE];

struct dma_desc{
	unsigned long ddadr;
	unsigned long dsadr;
	unsigned long dtadr;
	unsigned long dcmd;
} *read_desc, *write_desc;

#endif
